package com.payment.system.service.impl;

import java.util.List;

import com.payment.common.utils.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.payment.system.mapper.CardBinMapper;
import com.payment.system.domain.CardBin;
import com.payment.system.service.ICardBinService;
import com.payment.common.support.Convert;

/**
 * 卡bin维护 服务层实现
 * 
 * @author payment
 * @date 2018-12-27
 */
@Service
public class CardBinServiceImpl implements ICardBinService 
{
	@Autowired
	private CardBinMapper cardBinMapper;

	/**
     * 查询卡bin维护信息
     * 
     * @param iD 卡bin维护ID
     * @return 卡bin维护信息
     */
    @Override
	public CardBin selectCardBinById(String iD)
	{
	    return cardBinMapper.selectCardBinById(iD);
	}
	
	/**
     * 查询卡bin维护列表
     * 
     * @param cardBin 卡bin维护信息
     * @return 卡bin维护集合
     */
	@Override
	public List<CardBin> selectCardBinList(CardBin cardBin)
	{
	    return cardBinMapper.selectCardBinList(cardBin);
	}
	
    /**
     * 新增卡bin维护
     * 
     * @param cardBin 卡bin维护信息
     * @return 结果
     */
	@Override
	public int insertCardBin(CardBin cardBin)
	{
		cardBin.setID(StringUtils.randomUUID());
	    return cardBinMapper.insertCardBin(cardBin);
	}
	
	/**
     * 修改卡bin维护
     * 
     * @param cardBin 卡bin维护信息
     * @return 结果
     */
	@Override
	public int updateCardBin(CardBin cardBin)
	{
	    return cardBinMapper.updateCardBin(cardBin);
	}

	/**
     * 删除卡bin维护对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
	@Override
	public int deleteCardBinByIds(String ids)
	{
		return cardBinMapper.deleteCardBinByIds(Convert.toStrArray(ids));
	}

	@Override
	public CardBin selectCardBinByBankNo(Integer bankLength, String bankNo) {
		// TODO Auto-generated method stub
		return cardBinMapper.selectCardBinByBankNo(bankLength, bankNo);
	}
	
}
